// utils/deviceDetector.js
import { UAParser } from 'ua-parser-js'

export const getDeviceType = () => {
  const parser = new UAParser()
  const device = parser.getDevice()
  return device.type === 'mobile' ? 'mobile' : 'desktop'
}

export const getTargetPort = () => {
  return getDeviceType() === 'mobile' ? '9999' : '8999'
}